package com.aneliya.command.server;

import com.aneliya.framework.mvc.Facade;
import com.aneliya.framework.mvc.controller.ICommand;
import com.aneliya.framework.mvc.controller.MVCEvent;
import com.aneliya.model.Message;
import com.aneliya.proxy.MessagesProxy;

public class MessageReceivedCommand implements ICommand {

	public void execute(MVCEvent event) {
		try {
			Message message = (Message) event.data;
			MessagesProxy messagesProxy = 
				(MessagesProxy) Facade.getInstance().retrieveProxy("MessagesProxy");
			
			messagesProxy.receiveMessage(message, true);
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

}
